BR2_VERSION		= 2023.02.9

RED=\e[1;31m
NC=\e[0m

SHELL=/bin/bash

BRW_ROOT	= $(PWD)
BRW_DIR		= $(BRW_ROOT)/buildroot-$(BR2_VERSION)

CONF ?= lq_qemu_defconfig
O ?= $(CONF)
BR2_DL_DIR ?= $(BRW_ROOT)/dl

BRW_BUILD_DIR ?= $(CONF)


define CLEAN
	set -e; \
	rm -rf $(BRW_BUILD_DIR);
endef


.PHONY: all
all .DEFAULT:
	make -C $(BRW_DIR) $(CONF) O=$(BRW_BUILD_DIR) BR2_EXTERNAL=$(BRW_ROOT)
	make -C $(BRW_BUILD_DIR)


.PHONY: menuconfig
menuconfig:
	make -C $(BRW_BUILD_DIR) menuconfig

.PHONY: build
build:
	make -C $(BRW_BUILD_DIR)


.PHONY: savedefconfig
savedefconfig:
	make -C $(BRW_BUILD_DIR) savedefconfig


.PHONY: clean
clean:
	@$(call CLEAN)
